<!--{include(pe_tpl('header_dialog.html'));}-->
<form method="post" id="form">
<div class="tixing corg mab10">温馨提示：本页面仅允许单人操作，请不要多人操作，请不要多人操作，请不要多人操作！！！<a href="https://fahuo.cainiao.com" target="_blank" class="cblue">菜鸟面单打印平台：https://fahuo.cainiao.com</a></div>
<div class="now">
	<!--{foreach(array('wsend_0'=>'待发货 - 待导出', 'wsend_1'=>'待发货 - 已导出', 'wget'=>'已发货', 'success'=>'交易完成') as $k=>$v):}-->
	<a href="admin.php?mod=cainiao&state={$k}" <!--{if($_g_state==$k):}-->class="sel"<!--{endif;}-->>{$v}（{$tongji[$k]}）<i></i></a>
	<!--{endforeach;}-->
	<div class="clear"></div>
</div>
<div class="right_main">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
<tr>
	<th class="bgtt" width="20"><input type="checkbox" name="checkall" onclick="pe_checkall(this, 'order_id')" readonly /></th>
	<th class="bgtt" width="300">收件信息</th>
	<th class="bgtt">商品清单</th>
	<th class="bgtt" width="100">实付款</th>
	<th class="bgtt" width="100">发货时间</th>
	<th class="bgtt" width="200">订单状态</th>
	<th class="bgtt" width="50">操作</th>
</tr>
<!--{foreach($info_list as $v):}-->
<tr>
	<td><input type="checkbox" name="order_id[]" value="{$v['order_id']}" /></td>
	<td class="left">
		{$v['user_tname']}，{$v['user_phone']}
		<div>
			<span class="fl">{pe_cut($v['user_address'], 20, '..')}</span>
			<span class="fl mat5 copy" data-clipboard-text="{$v['user_tname']}，{$v['user_phone']}，{$v['user_address']}"></span>
			<div class="clear"></div>
		</div>
	</td>
	<td class="left">
		<!--{foreach($v['product_list'] as $vv):}-->
		<p><a href="{pe_url('product-'.$vv['product_id'])}" target="_blank" class="cblue">{pe_cut($vv['product_name'], 25, '..')}</a></p>
		<!--{endforeach;}-->
		<p class="mat5 c888">订单编号：{$v['order_id']}</p>
	</td>
	<td><span class="corg">{$v['order_money']}</span></td>
	<td>{pe_date($v['order_stime'], 'm-d H:i')}</td>
	<td>
		{order_stateshow($v['order_state'], 'html')}
		<!--{if($v['order_wl_id']):}-->
		<p class="mat5"><span class="tag_blue">{$v['order_wl_name']}</span></p>
		<p class="mat5"><span class="tag_blue">{$v['order_wl_id']}</span></p>
		<!--{endif;}-->
	</td>
	<td class="noclick"><a href="admin.php?mod=order&act=list&id={$v['order_id']}" target="_blank" class="admin_btn">详情</a></td>
</tr>
<!--{endforeach;}-->
</table>
</div>
<div class="right_bottom">
	<span class="fl">
		<input type="checkbox" name="checkall" onclick="pe_checkall(this, 'order_id')" />
		<input type="button" onclick="pe_checksel('order_id') && export_btn()" value="导出已勾选订单" />
		<input type="button" onclick="import_btn()" value="导入单号并自动发货" />
		<input type="button" onclick="pe_open('reload');" value="刷新" />
	</span>
	<span class="fr fenye">{$db->page->html}</span>
	<div class="clear"></div>
</div>
</form>
<link rel="stylesheet" href="{$pe['host']}include/plugin/layui/css/layui.css">
<script src="{$pe['host']}include/plugin/layui/layui.js"></script>
<script type="text/javascript" src="{$pe['host']}include/js/clipboard.min.js"></script>
<script type="text/javascript">
$(function(){
	$(":input:checkbox").click(function(){
		tongji_num();		
	})
	$(":input[name='express_id']").change(function(){
		window.location.href = 'admin.php' + $(this).find("option:selected").attr("href");
	})
})

function tongji_num() {
	var num = 0;
	$(".order_id:checked").each(function(){
		if (this.checked) {
			num++;
		}
	})
	$("#tongji").html(num);
}
//订单导出
function export_btn() {
	pe_confirm('导出已勾选订单', function(){
		$("form").attr("action", "admin.php?mod=cainiao&act=export").submit();
	})
};
//确认导出/打印
/*function export_confirm() {
	if ($(".order_id:checked").length == 0) {
		pe_tip('请先勾选订单');
		return false;
	}
	pe_submit("admin.php?mod=cainiao&act=confirm_print", function(json){
		if (json.code == 1) pe_open('reload', 1000);
	})
};*/
//订单导入
function import_btn() {
	pe_dialog("admin.php?mod=cainiao&act=import", '导入已打印订单并自动发货', 600, 300);
}
</script>
<!--{include(pe_tpl('footer_dialog.html'));}-->